package br.edu.faeterjrio.controle;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import br.edu.faeterjrio.entidade.Usuario;

@Controller
@RequestMapping("/usuarios")
public class UsuarioControle {
	
	@RequestMapping(value = "/{nomeAcesso}", method = RequestMethod.GET, headers = { "Accept=application/json" } )
	public @ResponseBody Usuario obterUsuario(@PathVariable String nomeAcesso) {
		String user="";
		if ("Belo".equals(nomeAcesso))
			user="Marcio";
		if ("Marques".equals(nomeAcesso))
			user="Genezys";
		return new Usuario(user);
	}
}
